package com.hit.aircraftwar.aircraft;

import com.hit.aircraftwar.activity.MainActivity;
import com.hit.aircraftwar.basic.BombAffectedObject;
import com.hit.aircraftwar.bullet.AbstractBullet;
import com.hit.aircraftwar.strategy.ShootStrategy;

import java.util.List;

/**
 * @author LiuYuZhe
 */
public class EliteEnemy extends AbstractAircraft implements BombAffectedObject {

    public EliteEnemy(int locationX, int locationY, int speedX, int speedY, int hp, ShootStrategy shootStrategy, int direction, int power, int shootNum) {
        super(locationX, locationY, speedX, speedY, hp, shootStrategy, direction, power, shootNum);
    }

    @Override
    public void forward() {
        locationX += speedX;
        locationY += speedY;
        if(locationX <= 0 || locationX >= MainActivity.width) {
            speedX = -speedX;
        }
    }

    @Override
    public List<AbstractBullet> shoot(AbstractAircraft abstractAircraft) {
        return abstractAircraft.shootStrategy.shoot(abstractAircraft);
    }

    @Override
    public void bombed() {
        this.vanish();
    }
}
